<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="https://www.w3.org/1999/xhtml" lang="zh-CN" xml:lang="zh-CN">
<head><meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
    <title>6.49. Psmisc-22.2</title>
    <link rel="stylesheet" href="../stylesheets/lfs.css" type="text/css" />
    <link rel="stylesheet" href="../stylesheets/lfs-print.css" type="text/css" media="print" />
<script> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?d286c55b63a3c54a1e43d10d4c203e75"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script>
</head>
  <body id="lfs" class="6.2">
    <div class="navheader">
      <div class="headertitles">
        <h4>Linux From Scratch - 版本 6.2</h4>
        <h3>第六章 安装系统基础软件</h3>
      </div>
      <ul class="headerlinks">
        <li class="prev">
          <a accesskey="p" href="patch.html" title="Patch-2.5.4">后退</a>
          <p>Patch-2.5.4</p>
        </li>
        <li class="next">
          <a accesskey="n" href="shadow.html" title="Shadow-4.0.15">前进</a>
          <p>Shadow-4.0.15</p>
        </li>
        <li class="up"><a accesskey="u" href="chapter06.html" title="第六章 安装系统基础软件">上一级</a></li>
        <li class="home"><a accesskey="h" href="../index.html" title="Linux From Scratch - 版本 6.2">首页</a></li>
      </ul>
    </div>
    <div class="wrap">
      <div class="titlepage">
        <h1 class="sect1">6.49. Psmisc-22.2</h1>
      </div>
      <div class="package">
        <p>Psmisc 包含有用于显示进程信息的程序。</p>
        <div class="segmentedlist">
          <div class="seglistitem">
            <div class="seg">
              <strong><span class="segtitle">预计编译时间：</span></strong> <span class="seg">少于 0.1 SBU</span>
            </div>
            <div class="seg">
              <strong><span class="segtitle">所需磁盘空间：</span></strong> <span class="seg">2.2 MB</span>
            </div>
          </div>
        </div>
      </div>
      <div class="installation">
        <div class="titlepage">
          <h2 class="sect2">6.49.1. 安装 Psmisc</h2>
        </div>
        <p>为编译 Psmisc 做准备：</p>
        <pre class="userinput"><kbd class="command">./configure --prefix=/usr --exec-prefix=""</kbd></pre>
        <div class="variablelist">
          <p class="title">
            <b>配置选项的含义：</b></p>
          <dl>
            <dt>
              <span class="term"><em class="parameter"><tt>--exec-prefix=""</tt></em></span>
            </dt>
            <dd>
              <p>这个确保 Psmisc 二进制文件按照 FHS 标准被安装在 <tt class="filename">/bin</tt> 而不是 <tt class="filename">/usr/bin</tt> ，因为一些 Psmisc 二进制文件将被 LFS-Bootscripts 使用。</p>
            </dd>
          </dl>
        </div>
        <p>编译软件包：</p>
        <pre class="userinput"><kbd class="command">make</kbd></pre>
        <p>这个软件包没有附带测试程序。</p>
        <p>安装软件包：</p>
        <pre class="userinput"><kbd class="command">make install</kbd></pre>
        <p>没有理由把 <span><strong class="command">pstree</strong></span> 和 <span><strong class="command">pstree.x11</strong></span> 程序安装在 <tt class="filename">/bin</tt> 中，所以将他们移动到 <tt class="filename">/usr/bin</tt> 中：</p>
        <pre class="userinput"><kbd class="command">mv -v /bin/pstree* /usr/bin</kbd></pre>
        <p>默认情况下， Psmisc 的 <span><strong class="command">pidof</strong></span> 程序未被安装。 这通常情况下不是问题。因为它将在这之后的 Sysvinit 包中被安装，而且这个包提供了一个更好的 <span><strong class="command">pidof</strong></span> 程序。如果你打算不使用 Sysvinit ，则可通过创建下面的符号连接来安装完整的 Psmisc ：</p>
        <pre class="userinput"><kbd class="command">ln -sv killall /bin/pidof</kbd></pre>
      </div>
      <div class="content">
        <div class="titlepage">
          <a id="contents-psmisc" name="contents-psmisc"></a>
          <h2 class="sect2">6.49.2. Psmisc 的内容</h2>
        </div>
        <div class="segmentedlist">
          <div class="seglistitem">
            <div class="seg">
              <strong><span class="segtitle">安装的程序：</span></strong> <span class="seg">fuser, killall,
              pstree, pstree.x11(→pstree)</span>
            </div>
          </div>
        </div>
        <div class="variablelist">
          <h3><a id="id3693140" name="id3693140"></a>简要描述</h3>
          <table border="0">
            <col align="left" valign="top" />
            <tbody>
              <tr>
                <td><a id="fuser" name="fuser"></a><span class="term"><span><strong class="command">fuser</strong></span></span></td>
                <td><p>报告使用所给文件或文件系统的进程的进程ID(PID)。</p></td>
              </tr>
              <tr>
                <td><a id="killall" name="killall"></a><span class="term"><span><strong class="command">killall</strong></span></span></td>
                <td><p>通过进程名来终止进程，它发送消息到所有正在运行任意所给指令的进程。</p></td>
              </tr>
              <tr>
                <td><a id="oldfuser" name="oldfuser"></a><span class="term"><span><strong class="command">oldfuser</strong></span></span></td>
                <td><p>报告使用所给文件或文件系统的进程的进程ID(PID)。</p></td>
              </tr>
              <tr>
                <td><a id="pstree" name="pstree"></a><span class="term"><span><strong class="command">pstree</strong></span></span></td>
                <td><p>以目录树的形式显示所有正在运行的进程</p></td>
              </tr>
              <tr>
                <td><a id="pstree.x11" name="pstree.x11"></a><span class="term"><span><strong class="command">pstree.x11</strong></span></span></td>
                <td><p>同 <span><strong class="command">pstree</strong></span> ，只是它在退出前要求确认</p></td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
    </div>
    <div class="navfooter">
      <ul>
        <li class="prev">
          <a accesskey="p" href="patch.html" title="Patch-2.5.4">后退</a>
          <p>Patch-2.5.4</p>
        </li>
        <li class="next">
          <a accesskey="n" href="shadow.html" title="Shadow-4.0.15">前进</a>
          <p>Shadow-4.0.15</p>
        </li>
        <li class="up"><a accesskey="u" href="chapter06.html" title="第六章 安装系统基础软件">上一级</a></li>
        <li class="home"><a accesskey="h" href="../index.html" title="Linux From Scratch - 版本 6.2">首页</a>.
        </li>
      </ul>
    </div>
</body></html>
